<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>添加/修改任务</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar" v-cloak>
        <div class="m-title">{{action=='Add'?'添加任务':action=='Modify'?'修改任务':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'patrol_task', 'form': 'dataForm', 'primary_key':'Task_SerialNumber' })">
      <div class="yl-main" v-cloak>
        <el-form :model="dataForm" ref="form" inline-message="true" style="width: 100%">
          <el-descriptions :column="2" size="large" border>
            <el-descriptions-item :span="2">
              <template #label>
                <div class="cell-item">任务名称：</div>
              </template>
              <el-form-item prop="Task_Name" :rules="[{ required: true, message: '请输入任务名称', trigger: 'blur' }]">
                <el-input v-model="dataForm.Task_Name" class="borderless-input" placeholder="请输入任务名称" />
              </el-form-item>
            </el-descriptions-item>

            <!-- <el-descriptions-item :span="2">
              <template #label>
                <div class="cell-item">巡逻类别：</div>
              </template>

              <el-form-item prop="Category_SerialNumber"
                :rules="[{ required: true, message: '请选择巡逻类别', trigger: 'change' }]">
                <yl-select :options="Category" :props="{label:'Category_Name',value:'Category_SerialNumber'}" clearable
                  v-model="dataForm.Category_SerialNumber" placeholder="请选择巡逻类别">
                  <el-table-column prop="Category_SerialNumber" width="180" show-overflow-tooltip
                    label="类别编号"></el-table-column>
                  <el-table-column prop="Category_Name" show-overflow-tooltip label="类别名称"></el-table-column>
                  <el-table-column prop="Category_Memo" show-overflow-tooltip label="类别描述"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item> -->


            <el-descriptions-item :span="2">
              <template #label>
                <div class="cell-item">巡逻队：</div>
              </template>
              <el-form-item prop="team_SerialNumber" :rules="[{ required: true, message: '请选择巡逻队', trigger: 'blur' }]">
                <yl-select filterable :options="team" :props="{label:'team_name',value:'team_SerialNumber'}" clearable
                  v-model="dataForm.team_SerialNumber" placeholder="请选择巡逻队">
                  <el-table-column prop="team_SerialNumber" width="180" show-overflow-tooltip
                    label="队伍编号"></el-table-column>
                  <el-table-column prop="team_name" show-overflow-tooltip label="队伍名称"></el-table-column>
                  <el-table-column prop="Contact_Phone" show-overflow-tooltip label="联系电话"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">任务开始：</div>
              </template>
              <el-form-item prop="Start_Date" :rules="[{ required: true, message: '请输入日期', trigger: 'blur' }]">

                <el-date-picker v-model="dataForm.Start_Date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                  class="borderless-input" type="date" placeholder="请选择任务开始时间" size="large" />
              </el-form-item>
            </el-descriptions-item>

            <el-descriptions-item>
              <template #label>
                <div class="cell-item">任务结束：</div>
              </template>
              <el-form-item prop="End_Date" :rules="[{ required: true, message: '请输入日期', trigger: 'blur' }]">

                <el-date-picker v-model="dataForm.End_Date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                  class="borderless-input" type="date" placeholder="请选择任务结束时间" size="large" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item :span="2">
              <template #label>
                <div class="cell-item">任务区域描述：</div>
              </template>
              <el-form-item prop="Task_Area" :rules="[{ required: true, message: '请输入任务区域描述', trigger: 'blur' }]">
                <el-input v-model="dataForm.Task_Area" class="borderless-input" placeholder="请输入任务区域描述" />
              </el-form-item>
            </el-descriptions-item>

            <el-descriptions-item :span="2">
              <template #label>
                <div class="cell-item">坐标集：</div>
              </template>
              <el-form-item prop="Coord" :rules="[{ required: true, validator:IS_Coords, trigger: 'blur' }]">
                <el-input v-model="dataForm.Coord" class="borderless-input" placeholder="请输入坐标集" />
              </el-form-item>
            </el-descriptions-item>

            <!-- <el-descriptions-item>
              <template #label>
                <div class="cell-item">巡逻次数：</div>
              </template>
              <el-form-item prop="Times" :rules="[{ required: false, message: '请输入巡逻次数', trigger: 'blur' }]">
                <el-input type="number" @input="validateInput" @change="validateInput" v-model="dataForm.Times"
                  class="borderless-input" placeholder="请输入巡逻次数(1~100)" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">巡逻周期：</div>
              </template>
              <el-form-item prop="Cycle" :rules="[{ required: false, message: '请输入巡逻周期', trigger: 'blur' }]">


                <el-select clearable v-model="dataForm.Cycle" placeholder="请选择巡逻周期" filterable
                  style="width: 100%">
                  <el-option v-for="(item,index) in CycleData" :key="index" :label="item.label"
                    :value="item.value"></el-option>
                </el-select>

              </el-form-item>
            </el-descriptions-item> -->

          </el-descriptions>
        </el-form>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" :loading="loading" plain @click="handleSubmit">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="js/add.js"></script>

</html>